package com.qfedu.yuxiaoer.controller;

import com.qfedu.yuxiaoer.common.service.PresetService;
import com.qfedu.yuxiaoer.dto.House;
import com.qfedu.yuxiaoer.entity.HouseDetachedBuild;
import com.qfedu.yuxiaoer.entity.HouseLease;
import com.qfedu.yuxiaoer.entity.PreLease;
import com.qfedu.yuxiaoer.entity.SourceResources;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 房源预定相关
 */
@RestController
@RequestMapping("/preset")
@ResponseBody
public class PresetController {
    @Autowired
    private PresetService presetService;

    /**
     * 查询预订接口
     * @param city
     * @param type
     * @param preLease
     * @return
     */
    @RequestMapping("/select")
    public List<PreLease> selectPreLease(String city, String type,PreLease preLease){
        List<PreLease> list = presetService.selectPreset(city,type,preLease);
        return list;
    }
    /**
     * 楼栋条件模糊查询
     */
    @RequestMapping("/like")
    public List<House> selectHouse(String string){
        List<House> list = presetService.selectHouse(string);
        return list;
    }
}
